#ifndef __iScopeable__
#define __iScopeable__

#include <vector>
#include <algorithm>

using std::vector;
using std::find;

namespace neiderra
{
	namespace utils
	{
		template <class T>
		class iScopeable
		{
			vector<T> _scopes;
		public:
			void enterScope(T scope) { _scopes.push_back(scope); }
			void leaveScope() { _scopes.pop_back(); }
			T getScope() { return _scopes.front(); }
			void clear() { _scopes.clear(); }
			bool isInScope(T scope){
				typename std::vector<T>::iterator i = _scopes.begin();
				i = find(_scopes.begin(), _scopes.end(), scope);
				if(i == _scopes.end())
					return false;
				else 
					return true;
			}
		};
	}
}

#endif
